//
//  PcPayViewModel.m
//  GLGW_Shoping
//
//  Created by yang on 2018/11/27.
//  Copyright © 2018年 yang. All rights reserved.
//

#import "PcPayViewModel.h"
#import "DashLineView.h"

@implementation PcPayViewModel

-(instancetype)initWithViewToViewScrollView:(UIScrollView *)scrollView theSuperView:(UIView *)superView{
    if (self = [super initWithViewToViewScrollView:scrollView theSuperView:superView]) {
        scrollView.y = scrollView.y + kHeightProportion_In_iPhoneTriploid(10);
        scrollView.height = scrollView.height - kHeightProportion_In_iPhoneTriploid(10);
        [superView addSubview:scrollView];
        //
        GLGWImageView * payImageView = [[GLGWImageView alloc] initWithFrame:CGRectMake((KScreenWidth - kWidthProportion_In_iPhoneTriploid(60))/2, kHeightProportion_In_iPhoneTriploid(20), kWidthProportion_In_iPhoneTriploid(60), kHeightProportion_In_iPhoneTriploid(60)) imageName:@"icon_dengdai" inSuperView:scrollView];
//        payImageView.backgroundColor = kRandomColor;
        //
        GLGWLabel * witerLabel = [[GLGWLabel alloc] initWithFrame:CGRectMake(0, kY_With_View(payImageView, 20), KScreenWidth, kHeightProportion_In_iPhoneTriploid(22)) theFont:SYSTEMFONT(16) theColor:kColor_Rule_Black inSuperView:scrollView];
        witerLabel.textAlignment = NSTextAlignmentCenter;
        witerLabel.text = @"等待处理";
        //
        GLGWLabel * toslabel = [[GLGWLabel alloc] initWithFont:SYSTEMFONT(14) theColor:[UIColor colorWithHexString:@"#999999"] inSuperView:scrollView];
        toslabel.textAlignment = NSTextAlignmentCenter;
        toslabel.numberOfLines = 0;
        toslabel.attributedText =[GLGWLabel changeLineWithSpace:8 theInoutText:@"您提交的付款方式属于“企业银行支付”\n 请前往“钢来钢网”PC端网站进行付款\n https://www.ganglaigangwang.com"];
        [toslabel mas_makeConstraints:^(MASConstraintMaker *make) {
            make.centerX.equalTo(scrollView);
            make.height.equalTo(@(kHeightProportion_In_iPhoneTriploid(80)));
            make.top.equalTo(witerLabel.mas_bottom).offset(kHeightProportion_In_iPhoneTriploid(10));
        }];
        //
        GLGWButton * pushWebBut = [[GLGWButton alloc] initWithFrame:CGRectMake(kWidthProportion_In_iPhoneTriploid(15), kY_With_View(witerLabel, 130), KScreenWidth - kWidthProportion_In_iPhoneTriploid(30), kHeightProportion_In_iPhoneTriploid(44)) hTitle:@"点击跳转到网站" titleLableFont:SYSTEMFONT(16) titleLableColor:[UIColor whiteColor] theCornerRadius:kHeightProportion_In_iPhoneTriploid(22) backgroundColr:kColor_Rule_Yellow inSuperView:scrollView];
        //
        DashLineView * lineXuView = [[DashLineView alloc] initWithFrame:CGRectMake(kWidthProportion_In_iPhoneTriploid(37), kY_With_View(pushWebBut, 28), 1, kHeightProportion_In_iPhoneTriploid(85)) withLineLength:3 withLineSpacing:1 withLineColor:kColor_Rule_Yellow];
        [scrollView addSubview:lineXuView];
        //
        NSArray * titArr = @[@"登录pc端网站",@"“个人中心”找到“我是买家”-“我的订单”",@"支付"];
        for (int i=0; i<3; i++) {
            GLGWLabel * numLabel = [[GLGWLabel alloc] initWithFrame:CGRectMake(kWidthProportion_In_iPhoneTriploid(30), lineXuView.y + kHeightProportion_In_iPhoneTriploid(35)*i, kWidthProportion_In_iPhoneTriploid(15), kHeightProportion_In_iPhoneTriploid(15)) theFont:SYSTEMFONT(14) theColor:kColor_Rule_Yellow inSuperView:scrollView];
            numLabel.textAlignment = NSTextAlignmentCenter;
            numLabel.layer.cornerRadius = kHeightProportion_In_iPhoneTriploid(7.5);
            numLabel.layer.borderWidth = 1.0;
            numLabel.layer.borderColor = kColor_Rule_Yellow.CGColor;
            numLabel.layer.masksToBounds = YES;
            numLabel.text = [NSString stringWithFormat:@"%d",i+1];
            numLabel.backgroundColor = [UIColor whiteColor];
            //
            GLGWLabel * tos_label = [[GLGWLabel alloc] initWithFrame:CGRectMake(kX_With_View(numLabel, 10), numLabel.y - kHeightProportion_In_iPhoneTriploid(2.5), KScreenWidth - kX_With_View(numLabel, 25), kHeightProportion_In_iPhoneTriploid(20)) theFont:SYSTEMFONT(14) theColor:[UIColor colorWithHexString:@"#666666"] inSuperView:scrollView];
            tos_label.text = titArr[i];
        }
    }
    return self;
}

@end
